#include <iostream>
using namespace std;

/*
    子类继承父类之后，子类的大小 = 父类大小 + 子类成员变量大小
    
*/

class Animal
{
public:
    void eat()
    {
        cout << "吃吃吃" << endl;
    }
    int age;

private:
    void run()
    {
        cout << "跑跑跑" << endl;
    }
    int weight;

protected:
    void sleep()
    {
        cout << "睡睡睡" << endl;
    }
    int height;
};

class Cat : public Animal
{
public:

    void catEat()
    {
        eat();
        cout << "喵喵喵" << endl;
    }
    void catSleep()
    {
        sleep();
        cout << "喵喵喵" << endl;
    }
    
};


int main()
{
    cout << "Animal size: " << sizeof(Animal) << endl;
    cout << "Cat size: " << sizeof(Cat) << endl;




    return 0;
}